package com.guigu.gulicart.entity.dto;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

import static com.guigu.gulicommon.constant.CheckParametersConstant.*;

/**
 * 修改购物车商品数量参数
 *
 * @author 陈俊杰
 * @version 1.0
 * @since 2024/9/24 14:32
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class UpdateCartItemDto {
    /**
     * 商品SkuId
     */
    @NotNull(message = SKU_ID_CANNOT_BE_NULL)
    private Long skuId;
    /**
     * 商品修改后的数量
     */
    @NotNull(message = SKU_PURCHASE_COUNT_CANNOT_BE_NULL)
    @Range(min = SKU_PURCHASE_COUNT_MIN_VALUE, max = SKU_PURCHASE_COUNT_MAX_VALUE, message = SKU_PURCHASE_COUNT_OUT_OF_BOUNDS)
    private Long count;
}
